{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_tcwq/template/public/ygcss.css">
<style type="text/css">
    input[type="radio"] + label::before {
        content: "\a0"; /*不换行空格*/
        display: inline-block;
        vertical-align: middle;
        font-size: 16px;
        width: 1em;
        height: 1em;
        margin-right: .4em;
        border-radius: 50%;
        border: 2px solid #ddd;
        text-indent: .15em;
        line-height: 1; 
    }

    input[type="radio"]:checked + label::before {
        background-color: #44ABF7;
        background-clip: content-box;
        padding: .1em;
        border: 2px solid #44ABF7;
    }

    input[type="radio"] {

        position: absolute;

        clip: rect(0, 0, 0, 0);

    }

</style>



<ul class="nav nav-tabs">    

    <span class="ygxian"></span>

    <div class="ygdangq">当前位置:</div>   

    <li><a href="{php echo $this->createWebUrl('plate')}">版块导航管理</a></li>

    <li class="active"><a href="{php echo $this->createWebUrl('addplate')}">添加版块导航</a></li>

</ul>

<div class="main ygmain">

    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">

        <!--<input type="hidden" name="parentid" value="{$parent['id']}" />-->

        <div class="panel panel-default ygdefault">

            <div class="panel-heading wyheader">

                内容编辑

            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">自定义类型</label>
                    <div class="col-sm-9">
                            <select name="type" class="col-md-5">
                            <option value="1" {if $info['type']==1}selected{/if}>最新消息</option>
                            <option value="2" {if $info['type']==2}selected{/if}>热门商家</option>
                            <!--<option value="3" {if $info['type']==3}selected{/if}>黄页114</option>-->
                            <!--<option value="4" {if $info['type']==4}selected{/if}>顺风车</option>-->
                            <!--<option value="5" {if $info['type']==5}selected{/if}>活动报名</option> -->
                            </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">自定义名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="name" class="form-control" value="{$info['name']}" />
                <span class="help-block">*自定义名称仅限制在首页导航栏展示，为空则显示为默认名称</span>

                    </div>

                </div>               

                <div class="form-group">

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>

                    <div class="col-sm-9">

                        <input type="text" name="sort" class="form-control" value="{$info['sort']}" />
                <span class="help-block">*排序由小到大,数字越小越排到前面</span>

                    </div>

                </div>

<!--                 <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否禁用</label>
                    <div class="col-sm-9">
                        <label class="radio-inline">
                            <input type="radio" id="emailwy1" name="status" value="1" {if $info['status']==1 || empty($info['status'])}checked{/if} />
                            <label for="emailwy1">启用</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="emailwy2" name="status" value="2" {if $info['status']==2}checked{/if} />
                            <label for="emailwy2">禁用</label>
                        </label>    
                    </div>
                </div> -->
            </div>
        </div>



        <div class="form-group">

            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>

            <input type="hidden" name="token" value="{$_W['token']}" />

            <input type="hidden" name="id" value="{$info['id']}" />

        </div>

    </form>

</div>

<script type="text/javascript">

    $(function(){

        // $(".ygyi1").show();

        // $(".ygyi2").hide();  

        // $(".ygyi3").hide();  

        

        "{if $info}"

            "{if $info['state']=='1'}"

                $('.ygyi2').hide();

                $('.ygyi3').hide();

            "{/if}"

            "{if $info['state']=='2'}"

                $('.ygyi1').hide();

                $('.ygyi3').hide();

            "{/if}" 

            "{if $info['state']=='3'}"

                $('.ygyi1').hide();

                $('.ygyi2').hide();

            "{/if}"            

        "{else}"

            $('.ygyi2').hide();

            $('.ygyi3').hide();

        "{/if}"

        $("select#type").change(function(){

            if($(this).val()=='1'){

                console.log($(this).val())

                $(".ygyi1").show();

                $(".ygyi2").hide();

                $(".ygyi3").hide();  

            }else if($(this).val()=='2'){

                console.log($(this).val())

                $(".ygyi1").hide();

                $(".ygyi2").show();

                $(".ygyi3").hide();  

            }else if($(this).val()=='3'){

                console.log($(this).val())

                $(".ygyi1").hide();

                $(".ygyi2").hide();

                $(".ygyi3").show();  

            }

         })

        $("#frame-17").show();

        $("#yframe-17").addClass("wyactive");

    })

</script>